const parse =  require('url').parse
const request = {
    // 谁调用 this 指向谁：ctx.request.method，指向 ctx.request
    get method(){
        return this.req.method
    },
    get header(){
        return this.req.headers
    },
    get url(){
        return this.req.url
    },
    get path(){
        return parse(this.req.url).pathname
    },
    get query(){
        return parse(this.req.url,true).query
    }
}



module.exports = request